﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace WebApplication1
{
    public partial class WebForm2 : System.Web.UI.Page
    {
        
        protected void Page_Load(object sender, EventArgs e)
        {
            lonig:
            if (Session["use"] == null)
            {
                Response.Redirect("WebForm1.aspx");
            }
            else if (Application["aaa"] == null)
            {
                Application["aaa"] = new Panel();
            }
            Panel1.Controls.Add((Panel)Application["aaa"]);
            
                            
            
        }



        protected void Button1_Click(object sender, EventArgs e)
        {
            string name = (string)Session["use"];
            string text = TextBox1.Text;
            string time = DateTime.Now.ToString();
            Literal1.Text = name + " " + time + "<br />" + text + "<br />";
            ((Panel)Application["aaa"]).Controls.Add(Literal1);
            TextBox1.Text = "";
            
        }

        
    }
}